package com.shrct.businessprocess.purchase;

import com.shrct.businessprocess.budget.IManualFinishableBudget;
import com.shrct.businessprocess.budget.RCBudgetTaskStatus;
import com.shrct.businessprocess.budget.RCCost4ACTItem;
import com.shrct.businessprocess.budget.RCProductDirectCostRequest;
import com.shrct.businessprocess.diagnose.IDiagnoseAcceptor;
import com.shrct.businessprocess.product.IHasProductMetaType;
import com.shrct.businessprocess.product.RCProductEntry;
import com.shrct.businessprocess.product.RCProductSpecification;
import com.shrct.businessprocess.project.RCExchangeRate;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.purchase.IHasAcceptedProducts;
import com.shrct.businessprocess.purchase.RCHasPurchaseBudget;
import com.shrct.businessprocess.purchase.RCPay;
import com.shrct.businessprocess.purchase.RCPayRequest;
import com.shrct.businessprocess.purchase.RCProductDeliverItem;
import com.shrct.businessprocess.purchase.RCProductInStockEvent;
import com.shrct.businessprocess.purchase.RCProductPurchaseItem;
import com.shrct.businessprocess.purchase.RCProductPurchaseRequest;
import com.shrct.businessprocess.purchase.RCTransforCostPayRequest;
import com.shrct.businessprocess.purchase.impl.RCBaseProductPurchaseBudgetImpl;
import com.shrct.businessprocess.purchase.proxy.RCBaseProductPurchaseBudgetProxy;
import edu.fudan.mylang.pf.EntityImplementation;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@EntityImplementation(implementBy = RCBaseProductPurchaseBudgetImpl.class)
public interface RCBaseProductPurchaseBudget extends RCHasPurchaseBudget, IManualFinishableBudget, IHasAcceptedProducts, IHasProductMetaType {
  public abstract Collection<RCTransforCostPayRequest> getTransforCostPayRequest();
  
  public abstract RCTransforCostPayRequest createAndAddtoTransforCostPayRequest();
  
  public abstract RCTransforCostPayRequest createAndAddtoTransforCostPayRequest(final Procedure1<RCTransforCostPayRequest> updater);
  
  public abstract RCBaseProductPurchaseBudget removeFromTransforCostPayRequest(final RCTransforCostPayRequest rCTransforCostPayRequest);
  
  public abstract RCBaseProductPurchaseBudget removeAllTransforCostPayRequest();
  
  public abstract Collection<? extends RCPayRequest> getAllPayRequests();
  
  public abstract RCProductPurchaseRequest createProductPurchaseRequest();
  
  /**
   * 获取产品清单
   */
  public abstract Collection<RCProductPurchaseItem> getItems();
  
  public abstract Boolean seemsFinished();
  
  public abstract RCBudgetTaskStatus getBudgetTaskStatus();
  
  /**
   * 根据发货记录计算指定产品的发货总数
   */
  public abstract Integer getTotalDeliveredQuantity(final RCProductSpecification productSpec);
  
  /**
   * 计算指定产品的请购数量
   */
  public abstract Integer getTotalRequestedQuantity(final RCProductSpecification productSpec);
  
  /**
   * 已订购数量
   */
  public abstract Integer getTotalPassedOrderedQuantity(final RCProductSpecification productSpec);
  
  /**
   * 已订购数量
   */
  public abstract Integer getTotalOrderedQuantity(final RCProductSpecification productSpec);
  
  /**
   * 根据收货记录计算指定产品的到货总数
   */
  public abstract Integer getTotalAcceptedQuantity(final RCProductSpecification productSpec);
  
  /**
   * 根据合同计算指定产品需求总数
   */
  public abstract Integer getTotalRequiredQuantity(final RCProductSpecification productSpec);
  
  /**
   * 根据合同计算指定产品需求总金额
   */
  public abstract RCProjectMoney getTotalRequiredAmount(final RCProductSpecification productSpec);
  
  /**
   * 计算手续费总金额
   */
  public abstract RCProjectMoney getTotalOtherAmount();
  
  public abstract RCProductDirectCostRequest createProductDirectCostRequest(final Procedure1<? super RCProductDirectCostRequest> init);
  
  public abstract void updateProductDirectCostRequest(final RCProductDirectCostRequest value, final Procedure1<? super RCProductDirectCostRequest> updator);
  
  public abstract void deleteProductDirectCostRequest(final RCProductDirectCostRequest value);
  
  /**
   * 服务订单金额
   */
  public abstract RCProjectMoney getTotalOrderAmount4Service();
  
  /**
   * 产品订单金额
   */
  public abstract RCProjectMoney getTotalOrderAmount4Product();
  
  /**
   * 服务订单相关金额
   */
  public abstract Double getTotalACTOrderAmount4Service();
  
  /**
   * 产品订单相关金额
   */
  public abstract Double getTotalACTOrderAmount4Product();
  
  /**
   * 汇总合同中的产品型号
   */
  public abstract Collection<RCProductSpecification> getAllProductSpecifications();
  
  public abstract Iterable<RCCost4ACTItem> getCost4ServiceACItems();
  
  public abstract Iterable<RCCost4ACTItem> getCost4ProductACItems();
  
  public abstract Iterable<RCCost4ACTItem> getCost4ACItems();
  
  public abstract Collection<RCPay> getAllPurchasePay();
  
  public abstract Collection<RCProductDeliverItem> getDeliveredItems(final RCProductSpecification productSpec);
  
  public abstract Collection<? extends RCProductInStockEvent> getInStockEvents(final RCProductSpecification productSpec);
  
  public abstract Iterable<RCProductEntry> getAllAcceptedProducts();
  
  public abstract String getEntityName();
  
  public abstract RCExchangeRate getDefaultPurchaseExchangeRate();
  
  public abstract String getName();
  
  public abstract String getTypeId();
  
  /**
   * 采购申请通过后调用
   */
  public abstract void purchaseRequestAuditPassed(final RCProductPurchaseRequest purchaseRequest);
  
  public abstract void diagnose(final IDiagnoseAcceptor acceptor);
  
  public abstract RCBaseProductPurchaseBudgetProxy toProxy();
}
